<?php
ob_start();
session_start();
$loginId=$_SESSION['loginid'];
$name=$_SESSION['name'];
$userType=$_SESSION['user_type'];
include_once('connection/connection.php');
include('config.php');
$frm=$_REQUEST['frm'];
?>
 <div id="scheme_section4" class="section_format">
 <script language="javascript" type="text/javascript" src="js/ajaxFunction_q2_new.js"></script>
  <form action="add_q2_hp.php" method="post" name="sampleform" id="sampleform" onSubmit="return sec4_val();">
  <table border="1">
  
    <tr>
      <td> <strong>&nbsp;Water Source Details</strong></td>
	  <td align="right"><b><?php echo "$rowMain[form_id]";?></b></td>
      </tr>
    <tr>
      <td width="400"><strong>&nbsp;Habitation Name
		  <input type="hidden" name="frmId" id="frmId" value="<?php echo $frm;?>" />
	  <input type="hidden" name="loginId" id="loginId" value="<?php echo $loginId;?>" />
	  <input type="hidden" name="name" id="name" value="<?php echo $name;?>" />
	  <input type="hidden" name="userType" id="userType" value="<?php echo $userType;?>" />
      </strong></td>
      <?php
	  $result=mysql_query("SELECT DISTINCT habit_code,habit_name from tbl_dtls_q2_habit where q2_id='$frm' order by id");
		?>
	  <td width="400">&nbsp;
	  <select name="habitation_name" id="habitation_name">
	  <option value="0">Select Habitation</option>
	  <?php 
	  while(list($id,$name)=mysql_fetch_array($result))
		 	{       
             	 echo "<option value=\"$id,$name\">$name</option>";
         	}
			?>	 
	  </select>	  </td>
      </tr>
    <tr>
      <td><strong>&nbsp;Type of Habitation</strong></td>
      <td>&nbsp;
	  <select name="type_mh_oh" id="type_mh_oh">
	  <option value="MH">MH</option>
	  <option value="OH">OH</option>
	  </select>	  </td>
      </tr>
	  <tr>
      <td><strong>&nbsp;HP/SP</strong></td>
      <td>&nbsp;
	  <select name="hp_sp" id="hp_sp">
	  <option value="HP">HP</option>
	  <option value="SP">SP</option>
	  </select>	  </td>
      </tr>
	  <tr>
      <td width="400"><strong>&nbsp;Location</strong></td>
      <td width="400">&nbsp;<input type="text" name="location" id="location"  /></td>
      </tr>
    <tr>
      <td><strong>&nbsp;Latitude </strong></td>
      <td>&nbsp;<input type="text" name="latitude" id="latitude" onBlur="float1(this,67,80);" /></td>
      </tr>
	  <tr>
      <td width="400"><strong>&nbsp;Longitude</strong></td>
      <td width="400">&nbsp;<input type="text" name="longitude" id="longitude" onBlur="float1(this,20,32);"/></td>
      </tr>
    <tr>
      <td><strong>&nbsp;Functional Status</strong></td>
      <td>&nbsp;<input type="radio" name="function_status" id="function_status" value="FUNCTIONAL" onClick="display(this.value)" checked />Functional
	  		<input type="radio" name="function_status" id="function_status" value="NOT FUNCTIONAL" onClick="display(this.value)"/>Not Functional		</td>
      </tr>
	   <tr><td colspan="2">  
	   <div id="showMydiv">
	   <table width="803" border="1">
	   <tr><td width="392"><strong>&nbsp;Operational Status</strong></td>
      <td width="395">&nbsp;<input type="radio" name="opration_status" id="opration_status" value="In Use" checked="checked">In Use
	  <input type="radio" name="opration_status" id="opration_status" value="Out of Use">Out Use	  </td>
      </tr>
	   <tr>
      <td><strong>&nbsp;Quality Status</strong></td>
      <td>&nbsp;<input type="radio" name="quality_status" id="quality_status" value="Potable" checked="checked">Portable
	  <input type="radio" name="quality_status" id="quality_status" value="Not Potable">Non Portable	  </td>
      </tr>
	   <tr>
      <td><strong>&nbsp;Yield</strong></td>
      <td>&nbsp;<input type="radio" name="yield" id="yield" value="Good" checked="checked">Good
	  <input type="radio" name="yield" id="yield" value="Satisfactory">Satisfactory
	   <input type="radio" name="yield" id="yield" value="Poor">Poor		</td>
      </tr>
	   <tr>
      <td><strong>&nbsp;Seasonal Fluctuation in Yield</strong></td>
      <td>&nbsp;<input type="radio" name="seasonal_flunctuation" id="seasonal_flunctuation" value="No Change" checked="checked">No Change
	  <input type="radio" name="seasonal_flunctuation" id="seasonal_flunctuation" value="Slight Change">Slight Change
	  <input type="radio" name="seasonal_flunctuation" id="seasonal_flunctuation" value="Drastic Change">Drastic Change	  </td>
      </tr>
	  <tr>
      <td><strong>&nbsp;Water Table Fluctuations (m) Min</strong></td>
      <td>&nbsp;<input type="text" name="fluctuation_min" id="fluctuation_min"  /></td>
      </tr>
	  <tr>
      <td><strong>&nbsp;Water Table Fluctuations (m) Max</strong></td>
      <td>&nbsp;<input type="text" name="fluctuation_max" id="fluctuation_max"  /></td>
      </tr>
	  <tr>
      <td colspan="2"><strong>&nbsp;Water Quality Parameter</strong></td>
      </tr>
	  <tr>
      <td><strong>&nbsp;pH</strong></td>
      <td>&nbsp;<input type="text" name="para_ph" id="para_ph"  value="" onBlur="check1(this,6,10);"/></td>
      </tr>
	  <tr>
      <td><strong>&nbsp;TDS (mg/l)</strong></td>
      <td>&nbsp;<input type="text" name="para_tds" id="para_tds"   value="" onBlur="check(this,100,40000);"/></td>
      </tr>
	  <tr>
      <td><strong>&nbsp;CL (mg/l)</strong></td>
      <td>&nbsp;<input type="text" name="para_cl" id="para_cl"  value="" onBlur="check(this,50,15000);" /></td>
      </tr>
	  <tr>
      <td><strong>&nbsp;F (mg/l)</strong></td>
      <td>&nbsp;<input type="text" name="para_f" id="para_f"  value="" onBlur="check1(this,0,18);" /></td>
      </tr>
	  <tr>
      <td><strong>&nbsp;NO3 (mg/l)</strong></td>
      <td>&nbsp;<input type="text" name="para_no3" id="para_no3"  value="" onBlur="check(this,0,2500);" /></td>
      </tr>
	  <tr>
	    <td><strong>&nbsp;Date of Sampling/Testing</strong></td>
	    <td>&nbsp;<input type="text" name="firstinput" id="firstinput" value="" readonly />&nbsp;<a href="javascript:showCal('Calendar1')"><img src="images/caldr.jpg" /></a></td>
	    </tr>
	  </table>
	  </div>
	  </td></tr>
	  <tr>
      <td colspan="2">
	  <div id="hideMydiv" style="display:none">
	  <table border="1">
	  <tr>
      <td width="394">&nbsp;Non Functional Status</td>
      <td width="395">&nbsp;
        <input type="radio" name="Repairable" id="Repairable" value="Repairable"  checked="checked"/>Repairable
	  <input type="radio" name="Repairable" id="Repairable" value="Non Repairable" />Non Repairable
	  <input type="radio" name="Repairable" id="Repairable" value="Abondoned" />Abandoned	      </td>
  </tr>
	   <tr>
      <td>&nbsp;Remarks</td>
      <td>&nbsp;<input type="text" name="remarks" id="remarks" value="<?php echo $row_status['remark'];?>"/>	  </td>
      </tr>
	  </table>
	  </div>	  </td>
	  </tr>
	 
	  <tr>
	    <td colspan="2" align="center"><input type="submit" value="EDIT" name="submit" style="font-size: 8pt; font-family: Verdana; border-style: solid; border-width: 1px; font-weight:bold; background:#666666; color:#FFFFFF; width:140px; height:30px" onClick="view_validate()"></td>
  </tr>
  </table>
  </form>
</div>